package config

type Server struct {
	System    System    `mapstructure:"system" json:"system" yaml:"system"`
	Jwt       Jwt       `mapstructure:"jwt" json:"jwt" yaml:"jwt"`
	Mysql     Mysql     `mapstructure:"mysql" json:"mysql" yaml:"mysql"`
	Redis     Redis     `mapstructure:"redis" json:"redis" yaml:"redis"`
	Log       Log       `mapstructure:"log" json:"log" yaml:"log"`
	Upload    Upload    `mapstructure:"upload" json:"upload" yaml:"upload"`
	OssConfig OssConfig `mapstructure:"oss_config" json:"oss_config" yaml:"oss_config"`
	JuHeApi   JuHeApi   `mapstructure:"juhe_api" json:"juhe_api" yaml:"juhe_api"`
}

type System struct {
	Addr   string `mapstructure:"addr" json:"addr" yaml:"addr"`
	SetMod string `mapstructure:"setmod" json:"setmod" yaml:"setmod"`
}

type Jwt struct {
	SigningKey string `mapstructure:"signing_key" json:"signing_key" yaml:"signing_key"`
}

type Mysql struct {
	Username     string `mapstructure:"username" json:"username" yaml:"username"`
	Password     string `mapstructure:"password" json:"password" yaml:"password"`
	Path         string `mapstructure:"path" json:"path" yaml:"path"`
	Config       string `mapstructure:"config" json:"config" yaml:"config"`
	Dbname       string `mapstructure:"dbname" json:"dbname" yaml:"dbname"`
	MaxIdleConns int    `mapstructure:"max-idle-conns" json:"max-idle-conns" yaml:"max-idle-conns"`
	MaxOpenConns int    `mapstructure:"max-open-conns" json:"max-open-conns" yaml:"max-open-conns"`
	LogMode      bool   `mapstructure:"log-mod" json:"log-mod" yaml:"log-mod"`
}

type Log struct {
	Writers        string `mapstructure:"writers" json:"writers" yaml:"writers"`
	LoggerLevel    string `mapstructure:"logger_level" json:"logger_level" yaml:"logger_level"`
	LoggerFile     string `mapstructure:"logger_file" json:"logger_file" yaml:"logger_file"`
	LogFormatText  bool   `mapstructure:"log_format_text" json:"log_format_text" yaml:"log_format_text"`
	RollingPolicy  string `mapstructure:"rolling_policy" json:"rolling_policy" yaml:"rolling_policy"`
	LogRotateDate  int    `mapstructure:"log_rotate_date" json:"log_rotate_date" yaml:"log_rotate_date"`
	LogRotateSize  int    `mapstructure:"log_rotate_size" json:"log_rotate_size" yaml:"log_rotate_size"`
	LogBackupCount int    `mapstructure:"log_backup_count" json:"log_backup_count" yaml:"log_backup_count"`
}

type Redis struct {
	Addr     string `mapstructure:"addr" json:"addr" yaml:"addr"`
	Password string `mapstructure:"password" json:"password" yaml:"password"`
	DB       int    `mapstructure:"db" json:"db" yaml:"db"`
}

type Upload struct {
	Path        string `mapstructure:"path" json:"path" yaml:"path"`
	UploadToOss bool   `mapstructure:"upload_to_oss" json:"upload_to_oss" yaml:"upload_to_oss"`
}

type OssConfig struct {
	EndpointUrl     string `mapstructure:"endpoint_url" json:"endpoint_url" yaml:"endpoint_url"`
	Endpoint        string `mapstructure:"endpoint" json:"endpoint" yaml:"endpoint"`
	AccessKeyId     string `mapstructure:"access_key_id" json:"access_key_id" yaml:"access_key_id"`
	AccessKeySecret string `mapstructure:"access_key_secret" json:"access_key_secret" yaml:"access_key_secret"`
	BucketName      string `mapstructure:"bucket_name" json:"bucket_name" yaml:"bucket_name"`
}

type JuHeApi struct {
	JokeKey    string `mapstructure:"joke_key" json:"joke_key" yaml:"joke_key"`
	ToutiaoKey string `mapstructure:"toutiao_key" json:"toutiao_key" yaml:"toutiao_key"`
	WeatherKey string `mapstructure:"weather_key" json:"weather_key" yaml:"weather_key"`
	JapiKey    string `mapstructure:"japi_key" json:"japi_key" yaml:"japi_key"`
	MobileKey  string `mapstructure:"mobile_key" json:"mobile_key" yaml:"mobile_key"`
}
